package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class Main extends Sprite
	{
		public static var numt:int = 1;
		
		public function Main()
		{
			if (stage) 
				init();
			else 
				addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			
			var timer:MyTimer = MyTimer.getInstance();
			timer.registerTimer("1", 1, 15, tick);
			
			var timer1:MyTimer = MyTimer.getInstance();
			timer1.registerTimer("2", 5, 0, tick1);
		}
		
		private function tick(...args):void
		{
			trace("tick(" + numt + "s)");
			numt++;
		}
		
		private function tick1(...args):void
		{
			trace("tick(5s)");
		}
	}
}